<template>
	<gracePage :customHeader="false">
		<!-- 页面主体 -->
		<view slot="gBody" style="margin-top: 50rpx;">
			<view class="juzhong">
			<video class="videos" id="myVideo" v-show="shuju.videos" :src="shuju.videos" :poster="shuju.img"></video>
			<image class="img" v-for="item in shuju.imgs" v-show="item" :src="item"></image>
			<text class="texts" v-show="shuju.describe">{{shuju.describe}}</text>
			</view>
			<ourLoading isFullScreen active text="加载中..." v-if="loadings" />
		</view>
	</gracePage>
</template>

<script>
	import gracePage from "../../graceUI/components/gracePage.vue";
	export default{
		data(){
			return {
				button_color:'',//按钮颜色
				shuju:{},
				loadings:false
			}
		},
		onLoad(opt) {
			var id = opt.id
			var vm = this;
			vm.loadings = true;
			this.myPost('api/Mycourse/get_info',{id:id},function(res){
				vm.loadings = false;
				console.log(res);
				if(res.code==200){
					vm.shuju = res.data
				}
			})
		},
		onReady() {
			// #ifndef MP-ALIPAY
			        this.videoContext = uni.createVideoContext('myVideo')
			        // #endif
		},
		methods:{
			back(){
				uni.navigateBack({
					delta:1
				})
			}
		},
		components:{
			gracePage
		}
	}
</script>

<style>
	.videos{
		/* position: fixed; */
		width: 100%;
		height: 300rpx;
		/* margin-left: 25%; */
	}
	.juzhong{
		position: fixed;
		width: 80%;
		margin-left: 10%;
	}
	.img{
		margin-top: 15rpx;
		width: 100%;
	}
	.texts{
		margin-top: 15rpx;
		font-size: 25rpx;
		color: #aaaaff;
	}
</style>
